package utils

import (
	"fmt"
	"go.mongodb.org/mongo-driver/v2/bson"
)

func PadZero(s string) string {
	return fmt.Sprintf("%02s", s)
}

func PadZeroInt(n int) string {
	return fmt.Sprintf("%02d", n)
}

func StringToObjectID(idStr string) (bson.ObjectID, error) {
	objectID, err := bson.ObjectIDFromHex(idStr)
	if err != nil {
		return bson.NilObjectID, err
	}
	return objectID, nil
}
